<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        var height = prompt("请输入身高(m)");
        var weight = prompt("请输入体重(kg)");
        var bmi = weight / (height * height);
        bmi = bmi.toFixed(2);
        var res = bmi > 23.9 ? "该减肥了" :bmi >=18.5 ? "健康" :"偏瘦";
        console.log(bmi,res);
    </script>
</head>
<body>
    
</body>
</html>